import 'package:bloc/bloc.dart';

enum ImglistEvent { add }

class ImglistBloc extends Bloc<ImglistEvent, List<String>> {
  @override
  List<String> get initialState => ['0'];

  @override
  Stream<List<String>> mapEventToState(ImglistEvent event) async* {
    switch (event) {
      // 添加图片
      case ImglistEvent.add:
        List<String> currentState = state.map((i) => i).toList();
        currentState.add("1");
        yield currentState;
        break;
    }
  }
}